#include "total.h"
#include "ui_total.h"
#include<sstf.h>
#include<fcfs.h>
#include<scan.h>

bus Bus;
int TOTAL_STATION=5;
int DISTANCE=2;
int distance = LENGTH * 4 / (TOTAL_STATION * DISTANCE);
QVector<QString>head;
QVector<QVector<int>> array; //输出的数组
QVector<QVector<int>> waittime; //等待时间
int curtime; //计时器
QString s;
QQueue<node> Q;
int x_1 = 100;
int y_1 = 180;
int x_2 = x_1 + LENGTH;
int y_2 = y_1 + LENGTH;
int bus_x = x_1;
int bus_y = y_1;


total::total(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::total)
{
    ui->setupUi(this);
    setFixedSize(600,400);


}
void total::on_SSTF_clicked(){
    QString b = ui->distance->text();
    QString a=ui->station->text();
    TOTAL_STATION=a.toInt();
    DISTANCE=b.toInt();
    SSTF *one=new SSTF();
    this->close();
    one->show();
}

void total::on_FCFS_clicked(){
    QString b = ui->distance->text();
    QString a=ui->station->text();
    TOTAL_STATION=a.toInt();
    DISTANCE=b.toInt();
    FCFS*two=new FCFS();
    this->close();
    two->show();
}
void total::on_SCAN_clicked(){
    QString b = ui->distance->text();
    QString a=ui->station->text();
    TOTAL_STATION=a.toInt();
    DISTANCE=b.toInt();
    SCAN*three=new SCAN();
    this->close();
    three->show();
}
total::~total()
{
    delete ui;
}
